const {ccclass, property} = cc._decorator;

@ccclass('Rkdy')
export class Rkdy extends cc.Component {

    @property(cc.Node)
    propagate: cc.Node = null;
    @property(cc.Node)
    topPanel: cc.Node = null;
    @property(cc.Prefab)
    namePanelBox: cc.Prefab = null;
    namePanel: cc.Node;

    onLoad() {
        const isTT = (window as any).tt != undefined;
        if (isTT) {
            this.propagate.active = false
        } else {
            this.propagate.active = true
        }
    }

    public openPanel() {
        if (this.namePanel) {
            this.namePanel.active = true;
        } else {
            this.namePanel = cc.instantiate(this.namePanelBox);
            this.namePanel.parent = this.topPanel;
        }
    }
}